# Copyright 2024 The NativeLink Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# This file is @generated by lre-rs.

"""Module extension to register different lre-rs tool repositories."""

load("@bazel_tools//tools/build_defs/repo:local.bzl", "new_local_repository")

# TODO(palfrey): Using module extensions here isn't optimal as it doesn't
#                    allow overriding tools via environment variables.
#                    Unfortunately rules_rust's rust_toolchain currently
#                    requires tools to be declared via labels to filegroups,
#                    so we need the new_local_repository approach here.
#                    Add support for raw strings to rules_rust upstream so
#                    that we can remove this module extension entirely.

def _lre_rs_impl(_mctx):
    new_local_repository(
        name = "lre-rs-stable-aarch64-darwin",
        build_file = "@local-remote-execution//rust:aarch64-darwin.BUILD.bazel",
        path = "/nix/store/i4zvfp6rqnfhdrgcdsmy9cyfwysa68rm-rust-default-1.87.0",
    )
    new_local_repository(
        name = "lre-rs-nightly-aarch64-darwin",
        build_file = "@local-remote-execution//rust:aarch64-darwin.BUILD.bazel",
        path = "/nix/store/qkkvv618fmcnbiiaanfdvnpv6glk98vx-rust-default-1.89.0-nightly-2025-05-21",
    )
    new_local_repository(
        name = "lre-rs-stable-aarch64-linux",
        build_file = "@local-remote-execution//rust:aarch64-linux.BUILD.bazel",
        path = "/nix/store/v3n983j0xpnyn6dsrdxw4q9xay5kqckl-rust-default-1.87.0",
    )
    new_local_repository(
        name = "lre-rs-nightly-aarch64-linux",
        build_file = "@local-remote-execution//rust:aarch64-linux.BUILD.bazel",
        path = "/nix/store/4ijxc9fn9rx0qky9wnyx74fb3316w6zg-rust-default-1.89.0-nightly-2025-05-21",
    )
    new_local_repository(
        name = "lre-rs-stable-x86_64-darwin",
        build_file = "@local-remote-execution//rust:x86_64-darwin.BUILD.bazel",
        path = "/nix/store/wa2fn4ijlpl0bn9gmqf4cb2x765gsmkx-rust-default-1.87.0",
    )
    new_local_repository(
        name = "lre-rs-nightly-x86_64-darwin",
        build_file = "@local-remote-execution//rust:x86_64-darwin.BUILD.bazel",
        path = "/nix/store/c8jiqhj6n6ilyq69108cn4p74mqfzn40-rust-default-1.89.0-nightly-2025-05-21",
    )
    new_local_repository(
        name = "lre-rs-stable-x86_64-linux",
        build_file = "@local-remote-execution//rust:x86_64-linux.BUILD.bazel",
        path = "/nix/store/1jnp3vxwdidkzi286mbmsxn8k9gbaa0n-rust-default-1.87.0",
    )
    new_local_repository(
        name = "lre-rs-nightly-x86_64-linux",
        build_file = "@local-remote-execution//rust:x86_64-linux.BUILD.bazel",
        path = "/nix/store/z6pgng01j5m20jrc7njak7fnbdfcy557-rust-default-1.89.0-nightly-2025-05-21",
    )

lre_rs = module_extension(implementation = _lre_rs_impl)
